{* $Id$ *}
{include_core file="admin/lib/header.html" title="已绑定设备列表"}
  <div class="page-header border-bottom clearfix">
    <h2 class="left">已绑定设备列表</h2>
      <a href="{get_url()}&is_excel=1" class="btn btn-success btn-sm right">导出EXCEL</a>
  </div>

  <div class="search-form js_advancedForm">
    <form action="device/admin/export_device" method="get" class="js_focusSearchForm">
      <p>
        <label for="" class="search-f-label">合伙人手机号：</label>
        <input type="text" class="search-f-ipt1" name="search_filter[mobile]" value="{$search_filter.mobile}">
      <p>
      <label for="" class="search-f-label">添加时间：</label>
        <input type="text" class="search-f-ipt1 search-f-ipt2" name="search_filter[start_date]" value="{$search_filter.start_date}" id="startDate">
        <span class="search-f-line"></span>
        <input type="text" class="search-f-ipt1 search-f-ipt2" name="search_filter[end_date]" value="{$search_filter.end_date}" id="stopDate">
      </p>
      <p><label for="" class="search-f-label"></label><button type="submit" class="btn btn-success btn-xs js_searchBtn">搜索</button></p>
    </form>
  </div>
  <!--start:列表-->
<div class="list-table-filters">
    <p>
        {$device_res_list = device_config::$TYPES}
        <span class="label label-info">按类型</span>
        <a href='{AnUrl("device/admin/export_device?{URLTracker::set("type", "ALL")}")}' {if URLTracker::val("type") == "ALL"} class="label label-primary" {else} class="label label-default" {/if}>全部</a>
        {foreach $device_res_list as $k => $v}
        <a href='{AnUrl("device/admin/export_device?{URLTracker::set("type", $k)}")}' {if URLTracker::val("type") == $k} class="label label-primary" {else} class="label label-default" {/if}>{$v.name}</a>
        {/foreach}
    </p>
</div>
{include_core file="admin/lib/pager.html"}
  <table class="list-table">
    <thead>
      <tr>
        <th style="min-width:60px;">序列号</th>
        <th style="min-width:60px;">状态</th>
        <th style="min-width:60px;">最新绑定信息</th>
        <th style="min-width:60px;">合伙人姓名</th>
        <th style="min-width:60px;">操作</th>
      </tr>
    </thead>
    <tbody>
      {foreach $device_list as $k=>$v}
        <tr id="dataList{$v.id}" {if $k%2 == 1} class="bg-gray"{/if} data-id="{$v.id}">
          <td>{$v.device_no}</td>
          <td>
            {machine_config::$status_list[$v.status]}
          </td>
          <td>
          {if $v.status == 2}
          店铺名：{$v.store_info.title}({$v.store_info.title_branch})<br/>
          店铺地址：
          <br/>&nbsp;&nbsp;省：{$v.store_info.province}
          <br/>&nbsp;&nbsp;市：{$v.store_info.city}
          <br/>&nbsp;&nbsp;区：{$v.store_info.county}
          <br/>&nbsp;&nbsp;详细地址：{$v.store_info.address}
          {/if}
          </td>
          <td>{$v.realname} | {$v.agency_id}</td>
          <td><a href="{AnUrl("device/admin/get_device_no_record?id={$v.dev_id}&device_no={$v.device_no}")}" class="btn btn-info btn-xs js_storeDeviceRecord"><i class="icon-trash icon-white"></i>设备历史</a></td>

        </tr>
      {foreachelse}
          <tr><td class="txtleft" colspan="6">暂无数据</td></tr>
      {/foreach}
    </tbody>
  </table>
  <script type="text/javascript">
  $(function(){
    // 高级搜索
    $('.js_advanced').click(function(e){
      e.preventDefault();
      var thisObj = $(this);
      var outBox  = thisObj.closest('form');
      if (thisObj.hasClass('js_isOpen')) {
        thisObj.removeClass('js_isOpen open');
        outBox.find('input').show();
        outBox.find('button').show();
        $('.js_advancedForm').hide();
      } else {
        thisObj.addClass('js_isOpen open');
        outBox.find('input').hide();
        outBox.find('button').hide();
        $('.js_advancedForm').show();
      }
    });

  });
  </script>
{include_core file="admin/lib/pager.html"}
<!--end:列表-->
{load_js file='zclip/jquery.zclip.min.js'}
{load_js file='zclip/ZeroClipboard.js'}
{include_core file="admin/lib/footer.html"}